﻿using FluentValidation;
using RockBus.DataContracts;

namespace RockBus.ConfigurationService.Validation
{
    public class RemoveSubscribersRequestValidator : AbstractValidator<RemoveSubscribersRequest>
    {
        public RemoveSubscribersRequestValidator()
        {
            this.RuleFor(x => x.SubscriberIds).NotNull();
            this.RuleFor(x => x.SubscriberIds).NotEmpty();
        }
    }

    public class RemoveClientSubscriptionsRequestValidator : AbstractValidator<RemoveSubscriptionsRequest>
    {
        public RemoveClientSubscriptionsRequestValidator()
        {
            this.RuleFor(x => x.SubscriberId).NotNull();
            this.RuleFor(x => x.SubscriberId).NotEmpty();
            this.RuleFor(x => x.SubscriptionIds).NotNull();
            this.RuleFor(x => x.SubscriptionIds).NotEmpty();
        }
    }

    public class RemoveClientPublishersRequestValidator : AbstractValidator<RemovePublishersRequest>
    {
        public RemoveClientPublishersRequestValidator()
        {
            this.RuleFor(x => x.PublisherIds).NotNull();
            this.RuleFor(x => x.PublisherIds).NotEmpty();
        }
    }

    public class RemoveClientReceivePortsRequestValidator : AbstractValidator<RemoveReceivePortsRequest>
    {
        public RemoveClientReceivePortsRequestValidator()
        {
            this.RuleFor(x => x.PublisherId).NotNull();
            this.RuleFor(x => x.PublisherId).NotEmpty();
            this.RuleFor(x => x.ReceivePortIds).NotNull();
            this.RuleFor(x => x.ReceivePortIds).NotEmpty();
        }
    }
}